package com.zk.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zk.bean.UserMsg;


@Service
public class RadioServiceImpl implements IRadioService{
	
	@Autowired
	IUserMsgService umService;
	
	
	@Override
	public Map<String,Object> receiveMsg(Map<String,Object> map) {
		System.err.println("****************接收到消息*****************");
		System.err.println(map.toString());
		UserMsg um = new UserMsg();
		SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
		String str = df.format(new Date());// new Date()为获取当前系统时间
		
		String id = String.valueOf(System.currentTimeMillis());
		um.setId(str+id);
		um.setValidStsCd("1");
		um.setMsgTypeCd("1001");
		um.setMsgStsCd("0");
		um.setMsgTitle("有一条新消息");
		um.setMsgCntt(map.get("content").toString());
		umService.saveMsg(um);
		return map;
	}

}
